﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Hotel.DAL.Migrations
{
    public partial class log1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "T_Admin",
                columns: table => new
                {
                    A_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    A_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    A_Pwd = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    A_Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    A_UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    A_Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    A_Date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Admin", x => x.A_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Discount",
                columns: table => new
                {
                    D_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DT_Id = table.Column<int>(type: "int", nullable: false),
                    D_Title = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    D_Color = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    D_Number = table.Column<int>(type: "int", nullable: false),
                    D_Quota = table.Column<int>(type: "int", nullable: false),
                    D_Money = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    D_Reduction = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    D_Discount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    StoreId = table.Column<int>(type: "int", nullable: false),
                    D_BeginTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    D_EenTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    D_State = table.Column<int>(type: "int", nullable: false),
                    IsDelte = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Discount", x => x.D_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Discount_Type",
                columns: table => new
                {
                    DT_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DT_Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Discount_Type", x => x.DT_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Level_Right",
                columns: table => new
                {
                    LRId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LevelId = table.Column<int>(type: "int", nullable: false),
                    RightId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Level_Right", x => x.LRId);
                });

            migrationBuilder.CreateTable(
                name: "T_Member",
                columns: table => new
                {
                    M_Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    M_Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    M_Pwd = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    M_Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    M_Type = table.Column<int>(type: "int", nullable: true),
                    M_Card = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    M_Date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    M_Sex = table.Column<bool>(type: "bit", nullable: true),
                    M_State = table.Column<int>(type: "int", nullable: true),
                    M_Photo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    M_Birth = table.Column<DateTime>(type: "datetime2", nullable: true),
                    M_Number = table.Column<int>(type: "int", nullable: true),
                    M_Money = table.Column<int>(type: "int", nullable: true),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false),
                    LevelId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Member", x => x.M_Id);
                });

            migrationBuilder.CreateTable(
                name: "T_Member_Level",
                columns: table => new
                {
                    LevelId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    LevelName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    LevelDesc = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    LevelMinGrow = table.Column<int>(type: "int", nullable: false),
                    LevelMaxGrow = table.Column<int>(type: "int", nullable: false),
                    LevelState = table.Column<int>(type: "int", nullable: false),
                    LevelDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    LevelChangeDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    RightId = table.Column<int>(type: "int", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Member_Level", x => x.LevelId);
                });

            migrationBuilder.CreateTable(
                name: "T_Member_Right",
                columns: table => new
                {
                    RightId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    RightName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RightDesc = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    RightState = table.Column<int>(type: "int", nullable: false),
                    RightDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    RightChangeDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Member_Right", x => x.RightId);
                });

            migrationBuilder.CreateTable(
                name: "T_Store",
                columns: table => new
                {
                    StoreId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StoreName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    StoreAddress = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    StorePhoto = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    StoreState = table.Column<int>(type: "int", nullable: false),
                    StoreDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    StoreChangeDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    StoreDesc = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDelete = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Store", x => x.StoreId);
                });

            migrationBuilder.CreateTable(
                name: "T_Store_Member",
                columns: table => new
                {
                    SMId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    StoreId = table.Column<int>(type: "int", nullable: false),
                    M_Id = table.Column<int>(type: "int", nullable: false),
                    M_Money = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    M_Pay_Money = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    M_Date = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Store_Member", x => x.SMId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_Admin");

            migrationBuilder.DropTable(
                name: "T_Discount");

            migrationBuilder.DropTable(
                name: "T_Discount_Type");

            migrationBuilder.DropTable(
                name: "T_Level_Right");

            migrationBuilder.DropTable(
                name: "T_Member");

            migrationBuilder.DropTable(
                name: "T_Member_Level");

            migrationBuilder.DropTable(
                name: "T_Member_Right");

            migrationBuilder.DropTable(
                name: "T_Store");

            migrationBuilder.DropTable(
                name: "T_Store_Member");
        }
    }
}
